<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/"
          xmlns:xi="http://www.w3.org/2001/XInclude" lang="en">

         <!--! This is the site layout -->
        <xi:include href="page.html" />
        <xi:include href="directory.html" />
        
        <head>
        <!-- We'll be using the javascript helpers later, so let's make sure we have them -->
        ${Markup(h.javascript_include_tag(builtins=True))}
        </head>
        <body>
            <div class="mainPage">
                <p>You can use this page to:
                    <ol><li> Deliver update pings to (for example) technorati to advise that your blog has been updated
                    (you can configure the ping targets in your configuration file).</li>
                    <li> Deliver trackbacks to urls referenced in your content, or to a manually entered trackback target.
                    Either way, if you want a trackback, you need to enter an excerpt from your blog entry.</li>
                    </ol>
                </p>
                <form action="$c.action" method="POST">
                    <h4> Update pings </h4>
                    <br/>
                        Deliver Ping: <input type="radio" name="doTechnorati" value="1" checked="1"/> Yes
                                    <input type="radio" name="doTechnorati" value="0"/> No. <br/>
                    <?python targetNumber=str(len(c.addresses)+1) ?>
                    <input type="hidden" value="$targetNumber" name="targetNumber"/>
                    <h4> Trackback </h4>
                        <p>Title: $c.page_title</p>
                        <p>Source URL: <a href="$c.source_url">$c.source_url</a></p>
                        <p>Choose trackback targets from the following: </p><br/>
                        <?python loop=[(c.addresses[i][0],c.addresses[i][1],str(i+1)) for i in range(len(c.addresses))]?>
                        <table>
                            <!-- These are the autogenerated possible trackback targets -->
                            <tr><th>Include?</th><th>URL</th><th></th></tr>
                            <tr py:for="index in loop">
                                <td><input type="checkbox" name="target${index[2]}"/></td>
                                <td><a href="${index[0]}">${index[1]}</a>
                                    <input type="hidden" value="${loop[0]}" name="target${index[2]}-url"/>
                                </td><td>(Inferred Target)</td>
                            </tr>
                            <!-- and a manual entry form -->
                            <tr>
                                <td><input type="checkbox" name="target${targetNumber}"/></td>
                                <td><input type="text" size="60" name="target${targetNumber}-url"/></td>
                                <td>(Manual Trackback)</td>
                            </tr>                                
                        </table><br/>
                        <p>Create an excerpt for your trackback by cutting pasting from 
                        your source (below) into the following box:</p><br/>
                        <textarea name="excerpt_content" rows="4" cols="80"/>
                        <input type="hidden" name="blog_name" value="$g.blog_name"/>
                        <input type="hidden" name="page_title" value="$c.page_title"/>
                        <input type="hidden" name="source_url" value="$c.source_url"/>
                        <input type="hidden" name="blog_url" value="$g.blog_url"/>
                        <br/><p>
                    <input type="submit" value="submit" /> update and/or trackback.</p>
                </form>
                <h4> Source Content for [${c.page_title}] Follows</h4>
                ${Markup(c.html)}
            </div>
        </body>
        
    </html>
